package com.itcast.es.pojo;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

@Document(indexName = "lyric",type = "article")
@Data
public class Article {
    @Id
    //index表示是否索引，type表示当前域的类型，store表示是否存储
    @Field(index = true,type = FieldType.Long,store = true)
    private Long id;

    @Field(index = true,type = FieldType.text,store = true,analyzer = "ik_max_word")
    private String title;

    @Field(index = true,type = FieldType.text,store = true,analyzer = "ik_max_word")
    private String content;
}
